<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>${title}</title>
<link rel="stylesheet" href="${base}/css/default.css" type="text/css">
<script type="text/javascript" src="${base}/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(function(){
	//区域选择-显示、隐藏层
	 $('#sa').click(function(){
		$(".mask1, .mask2, .li-sc-class, .li-sc-time").hide();
		$('.mask, .sm-area-box').toggle();
		$('html').removeClass("ho4"); 
		$('html').removeClass("ho5"); 
		$('html').toggleClass("ho3"); 
	 });
	 $('.mask').click(function(){
		$(this).hide();
		$('.sm-area-box').hide();
	    $('html').toggleClass("ho3");
	 });
	//类型选择
	$('.li-sc-2').click(function(){
		$('.sm-area-box, .mask, .mask2, .li-sc-time').hide();
		$('.mask1, .li-sc-class').toggle();
		$('html').removeClass("ho3"); 
		$('html').removeClass("ho5"); 
		$('html').toggleClass("ho4"); 
	});
	$('.mask1').click(function(){
		$(this).hide();
		$('.sm-area-box, .li-sc-class').hide();
		$('html').toggleClass("ho4");
	});
	//时间排序
	$('.li-sc-3').click(function(){
		$('.sm-area-box, .mask, .mask1, .li-sc-class').hide();
		$('.mask2, .li-sc-time').toggle();
		$('html').removeClass("ho3"); 
		$('html').removeClass("ho4"); 
		$('html').toggleClass("ho5"); 
	});
	$('.mask2').click(function(){
		$(this).hide();
		$('.sm-area-box, .li-sc-time').hide();
		$('html').toggleClass("ho5");
	});
	 //点击城市隐藏地区选择层和遮罩
//	 $('.sa-r-box span').click(function(){ 
//		$('.sm-area-box, .mask').hide();
//	   $('html').toggleClass("ho3");
//	 });

	//区域选择-选择地区
	$(".sa-r-box").hide();
	$(".sa-l ul li:first").addClass("active").show();
	$(".sa-r-box:first").show();
	$(".sa-l li").click(function() {
		$(".sa-l li").removeClass("active");
		$(this).addClass("active");
		$(".sa-r-box").hide(); 
		var activeTab = $(this).find("span").attr("id");
		//alert(activeTab);
		$(activeTab).fadeIn(0);
	});
		
	
});
</script>
</head>
<body>
<div class="mask"></div>
<div class="mask1"></div>
<div class="mask2"></div>
<header><a href="javascript:history.go(-1)" class="back"><span>返回</span></a><h2>搜索查询</h2></header>
<nav>
  <ul>
    <li class="n1"><a href="${base}/index/index"><cite></cite><span>首页</span></a></li>
    <li class="n2"><a href="${base}/search/index" class="on"><cite></cite><span>搜索</span></a></li>
    <li class="n3"><a href="${base}/subscribe/index"><cite></cite><span>订阅</span></a></li>
    <li class="n4"><a href="${base}/center/index"><cite></cite><span>我的</span></a></li>
  </ul>
</nav>
<div class="main search-zb-li">
	<div class="li-sc">
    	<ul class="li-sc-box">
        	<li class="li-sc-1"><span id="sa">地区</span><sub></sub></li>
        	<li class="li-sc-2"><span>类型</span><sub></sub></li>
        	<li class="li-sc-3"><span>排序</span><sub></sub></li>
        </ul>
        <div class="sm-area-box">
            <div class="sa-l">
                <ul>
                   <#list provinceList as province>
			           <li><span id="#tab${province_index}" value="${province.id}">${province.name}</span></li>
			       </#list>
                </ul>
            </div>
            <div class="sa-r">
            	<#list citylist as citys>
	               	<div id="tab${citys_index}" class="sa-r-box">
		                <ul>
		                	<#list citys.city as city>
		                    	<li><span value="${city.id}" type="${city.type}">${city.name}</span></li>
		                    </#list>
		                </ul>
	            	</div>
           		</#list>
            </div>
        </div>
        <div class="li-sc-class">
        	<ul>
            	<#list columnList as column>
                    <li><span value="${column.id}">${column.name}</li>
                </#list>
            </ul>
        </div>
        <div class="li-sc-time">
        	<ul>
            	<#list publicDateList as publicDate>
                 	<li><span value="${publicDate.id}">${publicDate.name}</span></li>
                </#list>
            </ul>
        </div>
    </div>
    <div class="dli clearfix">
    	<ul class="sea-m-list">
        	
        </ul>
    </div>
    <div class="li-more">上拉加载更多</div>
</div>

 	<script type='text/tmpl' id='itemTmpl'>
		<li>
        	<a href="${base}/detail/index?id=<!=id!>&type=<!=tableName!>" title="">
            	<div class="dli-box">
                    <strong><!=title!></strong>
                    <div>
                        <p>类型:<!=type!>&nbsp;&nbsp;&nbsp;发布日期:<!=updateTime!></p>
                        <b><!=area!></b>
                    </div>
                </div>
            </a>
            <div class="favor"><span onclick="tocollect(this)" value="<!=id!>" type="<!=tableName!>" <!if(collections!=0){!>class="sc"<!}!>>收藏</span></div>
        </li>
    </script>
    <input type="hidden" id="keywords" value="${queryEntity.keywords}"/>
	<input type="hidden" id="scope" value="${queryEntity.scope}"/>
	<input type="hidden" id="area" value="${queryEntity.area}"/>
	<input type="hidden" id="areaType" value="${queryEntity.areaType}"/>
	<input type="hidden" id="category" value="${queryEntity.category}"/>
	<input type="hidden" id="column" value="${queryEntity.column}"/>
	<input type="hidden" id="publicDateValue" value="${queryEntity.publicDateValue}"/>

</body>
<script type="text/javascript" src="${base}/js/public/lib/zepto.min.js"></script>
<script type="text/javascript" src="${base}/js/public/lib/baiduTemplate.js"></script>
<script type="text/javascript" src="${base}/js/public/lib/config.js"></script>
<script type='text/javascript' src="${base}/js/public/lib/jquery.textSearch-1.0.js"></script>
<script type="text/javascript" src="${base}/js/public/search/list.js"></script>
<script  type="text/javascript">
function tocollect(obj){
	var $v=$(obj);
	//console.log($v.attr('value'))
	var id = $v.attr('value');
	var type = $v.attr('type');
	
	$.ajax({
			'url':'${base}/collect/insert',
			'type':'post',
			dataType:'json',
			data:{id:id,type:0},//0是news收藏
			success:function(data){
				alert(data.message);
			}
		});
		$v.toggleClass('sc');
}


</script>
</html>
